A Trip Down Memory Lane in Haskell

نویسندگان

  • Neil C. C. Brown
  • Adam T. Sampson
چکیده

While writing a compiler in Haskell, we had a problem with a large memory usage. We show how, by changing only a few small aspects of our design, we were able to reduce the live memory use of our program from 650 megabytes down to a mere 10 megabytes. We examine the aspects of our program that caused this problem: the writer monad and generic programming. We conclude that Haskell is a powerful, useful and fun programming language, but that programmers must remain careful as to which techniques they choose to use, and must keep a close eye on their memory profile throughout the development process.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Multigrid convergence: a brief trip down memory lane

Wemake a brief algebraic survey of the highlights of the classical convergence theory for multigrid methods, in particular, the multigrid V-cycle.

متن کامل

Towards a Verified Implementation of Software Transactional Memory

In recent years there has been much interest in the idea of concurrent programming using transactional memory, for example as provided in STM Haskell. While programmers are provided with a simple high-level model of transactions in terms of a stop-the-world semantics, the low-level implementation is rather more complex, using subtle optimisation techniques to execute multiple concurrent transac...

متن کامل

Nhc: a Space-eecient Haskell Compiler

Self-compiling implementations of Haskell, i.e., those written in Haskell, have been and, except one, are still space consuming monsters. Object code size for the compilers themselves are 3-8 Mbyte, and they need 12-20 Mbyte to recompile themselves. One reason for the huge demands for memory is that the main goal for these compilers is to produce fast code. However, the compiler described in th...

متن کامل

Implementing Software Transactional Memory, Correctly

In recent years there has been much interest in the idea of concurrent programming using transactional memory, for example as provided in STM Haskell. While programmers are provided with a simple high-level model of transactions in terms of a stop-the-world semantics, the low-level implementation is rather more complex, involving subtle techniques that allow multiple transactions to execute con...

متن کامل

Environmental impact assessment of bus rapid transit (BRT) in the Metropolitan City of Tehran

Bus rapid transit is an innovative, high capacity, lower cost public transit solution in metropolitan cities. Idea is to dedicate lanes for quick and efficient transport of passengers to their destinations. In the present investigation the environmental impact assessment of bus rapid transit  in Tehran metropolitan city is brought out. For this purpose bus rapid transit Lane No. 10 is investiga...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009